import 'package:flutter/material.dart';
import 'package:todo_list/components/base/neu_box.dart';
import 'package:todo_list/page/home_page/components/home_body.dart';
import 'package:todo_list/page/home_page/components/setting_drawer.dart';
import 'package:todo_list/page/home_page/components/user_drawer.dart';

class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: '简记',
      home: Scaffold(
        backgroundColor: Colors.grey[350],
        appBar: AppBar(
          backgroundColor: Colors.grey[350],
          title: const Text('简记'),
          leading: Builder(
            builder: (context) => NeuBox(
              padding: const EdgeInsets.all(0),
              margin: const EdgeInsets.all(8),
              borderRadiusSize: 30,
              child: IconButton(
                  onPressed: () {
                    // Navigator.pushNamed(context, "/login");
                    Scaffold.of(context).openDrawer();
                  },
                  icon: const Icon(Icons.account_circle)),
            ),
          ),
          actions: [
            Builder(
                builder: (context) => NeuBox(
                      width: 40,
                      padding: const EdgeInsets.all(0),
                      margin: const EdgeInsets.all(8),
                      borderRadiusSize: 30,
                      child: IconButton(
                          onPressed: () {
                            Scaffold.of(context).openEndDrawer();
                          },
                          icon: const Icon(Icons.settings)),
                    )),
          ],
        ),
        drawer: const UserDrawer(),
        endDrawer: const SettingDrawer(),
        body: const HomeBody(),
      ),
    );
  }
}
